const express = require('express');

const app = express();

app.get('/getJsonp',(req,res)=>{

    // 接收参数
    let {cb} = req.query;

    let data = {
        name:"fuwuduandelaowang",
        age:18
    }

    // 字符串
    let json = JSON.stringify(data);

    console.log(json); // '{"name":"fuwuduandelaowang","age":18}'

    console.log(typeof json); //string
    
    res.send(`${cb}(${json})`);
});

app.listen(80,()=>{
    console.log("启动成功");
});